﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Downloader.Domain;
using Downloader.Domain.Contracts.Tasks;
using SharpArch.Domain.PersistenceSupport;

namespace Downloader.Tasks
{

    public class FriendlyLinkTasks : IFriendlyLinkTasks
    {
        public IRepository<FriendlyLink> Repository { get; set; }

        public List<FriendlyLink> GetAll()
        {
            return Repository.GetAll().ToList();
        }

        public FriendlyLink Get(int id)
        {
            return Repository.Get(id);
        }

        public Domain.FriendlyLink CreateOrUpdate(Domain.FriendlyLink articleContent)
        {
            return Repository.SaveOrUpdate(articleContent);
        }

        public void Delete(int id)
        {
            var t = Repository.Get(id);
            Repository.Delete(t);
        }
    }
}
